package com.caifu.mapper;

import com.caifu.pojo.YlRoom;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author GZ
 * @since 2020-11-05
 */
public interface YlRoomMapper extends BaseMapper<YlRoom> {
    /**
    * 
    * 功能描述：查询房间信息
    * 
    * @Param  roomName 房间名称  floorNo楼层编号
    * @Return      
    * @Exception   
    * @Author  GZ
    * @Date   2020/11/8 16:50
    */
    @Select({"<script>",
            "select * from yl_room where ROOM_STATE='1' ",
            "and room_name =#{roomName}",
            "and FLOOR_NO =#{floorNo}",
            "</script>"})
    YlRoom queryRoomInfoByName(@Param("roomName") String roomName,@Param("floorNo") String floorNo);
    /**
     *
     * 功能描述：查询总房间数
     *
     * @Param  floorNo 楼层编号
     * @Return
     * @Exception
     * @Author  GZ
     * @Date   2020/11/8 11:08
     */
    @Select({"<script>",
            "select count(*) from yl_room where FLOOR_NO =#{floorNo} and ROOM_STATE='1' ",
            "</script>"})
    int queryTotalRoom(String floorNo);
}
